using UnityEngine;
using UnityEngine.UI;

public class Alert : MonoBehaviour
{
	public Text message;

	public Canvas canvas;

	public bool isGood;

	public AudioClip badAudio;

	public AudioClip goodAudio;

	public AudioSource audioSource;

	private void Awake()
	{
		Close();
	}

	public void Show(string text)
	{
		audioSource.clip = badAudio;
		audioSource.Play();
		canvas.enabled = true;
		message.text = text;
	}

	public void ShowGood(string text)
	{
		audioSource.clip = goodAudio;
		audioSource.Play();
		canvas.enabled = true;
		message.text = text;
	}

	public void Close()
	{
		canvas.enabled = false;
	}
}
